<?php

namespace app\api\controller;

use think\Request;
use think\facade\View;

class BaseController
{

    /**
     * 控制器中间件
     * @var array
     */
    protected $middleware = [
        'api_login', // 登录中间件
    ];

    /**
     * 请求对象
     * @var
     */
    protected $request;

    /**
     * 分页当前页数
     * @var
     */
    public $page;

    /**
     * 分页每条查询条数
     * @var
     */
    public $limit;

    /**
     * 中间件获取的用户信息
     * @var
     */
    public $user_info;

    public function __construct(Request $request)
    {
        $this->request = $request;

        $this->page    = $request->param('page', 1);
        $this->limit   = $request->param('limit', 10);

        $this->user_info = $request->user_info;

    }

}
